AccumulatorFlow

class AccumulatorFlow<T>(sourceDataFlow: Flow<T>, scope: CoroutineScope) : AbstractFlow<T>

This Flow will have behaviour very similar to SharedFlow, but there are several differences:

  • All unhandled by FlowCollector data will not be removed from AccumulatorFlow and will be sent to new FlowCollectors until anybody will handle it

  • Here there are an activeData where data T will be stored until somebody will handle it

Constructors

Link copied to clipboard
fun <T> AccumulatorFlow(sourceDataFlow: Flow<T>, scope: CoroutineScope)

Functions

Link copied to clipboard
suspend override fun collect(collector: FlowCollector<T>)
Link copied to clipboard
open suspend override fun collectSafely(collector: FlowCollector<T>)